<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<section class="panel">
    <div class="panel-body">
        <div></div>
        <table class="table no-m">
            <thead>
            <tr>
                <th>住院号</th>
                <th>姓名</th>
                <th>床</th>
                <th>项目名称</th>
                <th>规格</th>
                <th>数量</th>
                <th>单位</th>
                <th>计价金额</th>
                <th>应收金额</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${billDetails}" var="billDeatils" varStatus="status">
                <tr>
                    <c:choose>
                        <c:when test="${status.count==1}">
                            <td>${billDeatils.visit_no}</td>
                            <td>${billDeatils.name}</td>
                            <td>${billDeatils.bed_no}</td>
                        </c:when>
                        <c:otherwise>
                            <td></td>
                            <td></td>
                            <td></td>
                        </c:otherwise>
                    </c:choose>
                    <td>${billDeatils.item_name}</td>
                    <td>${billDeatils.item_spec}</td>
                    <td>${billDeatils.amount}</td>
                    <td>${billDeatils.units}</td>
                    <td>${billDeatils.costs}</td>
                    <td>${billDeatils.charges}</td>
                    <c:set var="totalCosts" value="${billDeatils.total_costs+totalCosts}"></c:set>
                    <c:set var="totalCharges" value="${billDeatils.total_charges+totalCharges}"></c:set>
                </tr>
            </c:forEach>
                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>合计：</td>
                    <td><c:out value="${totalCosts}"></c:out></td>
                    <td><c:out value="${totalCharges}"></c:out></td>
                </tr>
            </tbody>
        </table>
    </div>
</section>